// 设置宽高
@mixin size($width, $height: $width) {
  @if unitless($width) {
    $width: $width * 1px;
  }

  @if unitless($height) {
    $height: $height * 1px;
  }

  width: $width;
  height: $height;
}

// 多行文本溢出
@mixin ellipsis($line: 1) {
  overflow: hidden;
  text-overflow: ellipsis;

  @if $line <=1 {
    white-space: nowrap;
  }

  @else {
    display: -webkit-box;
    -webkit-line-clamp: $line;
    -webkit-box-orient: vertical;
  }
}

@mixin flex {
  display: flex;
  align-items: center;
}

@mixin flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

@mixin flex-center-horizontal {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

@mixin flex-horizontal {
  display: flex;
  align-items: center;
  flex-direction: column;
}

@mixin flex-space-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@mixin flex-space-around {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

@mixin flex-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

@mixin flex-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

// flex布局加上下居中
@mixin flexCenter() {
  display: flex;
  align-items: center;
}
